import math

import numpy

def gauss(x, A, mu, sigma):
    z = (x - mu) / sigma

    # This means A == area of gauss
    scale = A / (math.sqrt(2*math.pi) * sigma)

    return scale*numpy.exp(-0.5*z**2)


# From mn_fit/src/function/xmnclc.fpp: (two gauss)
#
# c    DXBIN = bin width
# c    ZS2PI = 1 / sqrt(2*pi)
#
#      VAL = DXBIN * ZS2PI
#      DELX = DPX - P(2)
#      IF(P(3) .NE. 0.) THEN
#          DZ1  = 1.0D0 / P(3)
#          DZ2  = -0.5D0 * ( DELX*DZ1 )**2
#          IF(DABS(DZ2).LE.DEXPMX) XMNCLC = XMNCLC + DEXP(DZ2)*DZ1*VAL
#     1     * P(1) * (1.0 - P(4))
#      ENDIF
#      DELX = DPX - P(2) - P(5)
#      IF(P(3).NE.0. .AND. P(6).NE.0.) THEN
#          DZ1  = 1.0D0 / (P(3) * P(6))
#          DZ2  = -0.5D0 * ( DELX*DZ1 )**2
#          IF(DABS(DZ2).LE.DEXPMX) XMNCLC = XMNCLC + DEXP(DZ2)*DZ1*VAL
#     1     * P(1) * P(4)
#      ENDIF
#      RETURN

def double_gauss(x, A1, mu1, sigma1, A2oA1, delta_mu, sigma2osigma1):
    val = x * 1/math.sqrt(2*math.pi)
    

    a1 = (A1 * (1 - A2oA1)) / 
